#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
//http://www.oj7.cn/
struct node
{
	double x, y;
}p[200001];
int n;
double Min;
bool com(node a,node b)
{
	return a.x < b.x;
}
bool com1(node a, node b)
{
	return a.y < b.y;
}
double dis(int l, int r)
{
	return sqrt(((p[l].x - p[r].x) * (p[l].x - p[r].x) + (p[l].y - p[r].y) * (p[l].y - p[r].y)));
}
double getmin(int l, int r)
{
	if (r - l == 1)return dis(r, l);
	if (r - l == 2)
	{
		double d1 = dis(r, l);
		double d2 = dis(r-1, l);
		double d3 = dis(r, 1+l);
		return min(min(d1, d2), d3);
	}
	int m = (l + r) / 2;
	double d1 = dis(l, m);
	double d2 = dis(m+1, r);
	Min = min(d1, d2);
	while (p[l].x < p[m].x - Min && l < r)
	{
		l++;
	}
	while (p[r].x > p[m].x + Min && r > l)
	{
		r--;
	}
	sort(p, p + n, com1);
	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			if (p[j].y - p[i].y > Min)
			{
				break;
			}
			else
			{
				double d3 = dis(j, i);
				Min = min(d3, Min);
			}
		}
	}
	return Min;
}
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> p[i].x >> p[i].y;
	}
	sort(p, p + n, com);
	cout << fixed << setprecision(4) << getmin(0, n - 1)<< endl;;
	return 0;
}